#include <bits/stdc++.h>
using namespace std;
int a[100005];
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    int n;
    cin >> n;
    int x = 0,y = 0;
    for(int i = 1;i <= n;i++)
    {
        cin >> a[i];
        if(a[i] == 1)
        {
            x++;
        }
        else
        {
            y++;
        }
    }
    cout << max(x,y);
    return 0;
}
